package com.mybed.crm.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Mapper
public interface ReportMapper {
    //获取线索数量
    Integer getCluesNum(@Param("startTime") String beginCreateTime,
                        @Param("endTime") String endCreateTime);

    //获取商机数量
    Integer getBusinessNum(@Param("startTime") String beginCreateTime,
                           @Param("endTime") String endCreateTime);

    //获取合同数量
    Integer getContractNum(@Param("startTime") String beginCreateTime,
                           @Param("endTime") String endCreateTime);

    //获取合同金额
    Double getSalesAmount(@Param("startTime") String beginCreateTime,
                          @Param("endTime") String endCreateTime);


    /**
     * 获取今日新增线索数量
     *
     * @param now
     * @param end
     * @return
     */
    Integer getTodayCluesNum(LocalDate now, LocalDate end);

    /**
     * 获取今日新增商机数量
     *
     * @param now
     * @param end
     * @return
     */
    Integer getTodayBusinessNum(LocalDate now, LocalDate end);

    /**
     * 获取今日新增合同数量
     *
     * @param now
     * @param end
     * @return
     */
    Integer getTodayContractNum(LocalDate now, LocalDate end);

    Double getTodaySalesAmount(LocalDate now, LocalDate end);

    /**
     * 获取无效线索数量
     * @return
     */
    Integer getInvalidCluesNums();

    /**
     * 获取待分配线索数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getToallocatedCluesNum(String beginCreateTime, String endCreateTime);

    /**
     * 获取待跟进线索数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getTofollowedCluesNum(String beginCreateTime, String endCreateTime);

    /**
     * 获取待分配商机数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    //Integer getToallocatedBusinessNum(String beginCreateTime, String endCreateTime);

    /**
     * 获取待跟进商机数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getTofollowedBusinessNum(String beginCreateTime, String endCreateTime);
}
